package combat;

import java.util.HashMap;

import org.bukkit.entity.LivingEntity;

public class ResistanceManager {
	private static HashMap<LivingEntity, Resistance> resistances = new HashMap<LivingEntity, Resistance>();

	public static void remove(LivingEntity target) {
		if (resistances.containsKey(target)) {
			resistances.remove(target);
		}
	}
	
	public static void buff(LivingEntity target) {
		if (resistances.containsKey(target)) {
			resistances.get(target).buff();
		}
		else {
			resistances.put(target, new Resistance(target));
			resistances.get(target).buff();
		}
	}
	
	public static void debuff(LivingEntity target) {
		if (resistances.containsKey(target)) {
			resistances.get(target).debuff();
		}
		else {
			resistances.put(target, new Resistance(target));
			resistances.get(target).debuff();
		}
	}
}
